check_keyword
A trait for Strings and &str's to check if a string is a reserved keyword, and convert it to a safe non-keyword if so.
Only strict and reserved keywords are checked against; weak keywords are not included.
You can add this dependency with:
[]
= "0.1.1"
Examples
use CheckKeyword;
let keyword = "match";
assert!;
assert_eq!;
// There's also a self-consuming version if you want
assert_eq!;
Rust Editions
By default, the keywords added in Rust Edition 2018 are included in the list of checked keywords.
This can be disabled with default-features = false
in your Cargo.toml.
[]
= { = "0.1.1", = false }
Future Rust editions may add new keywords, and this crate will be updated to reflect that. (Or you can create an issue on github if I don't.)
License: MIT OR Apache-2.0